U4Ch1L10_Functions Practice

Purpose: Students will practice using the skills and processes they have learned about functions.


Activity:  U4Ch1L10_Level1: Debug the Function

Hint: The ‘Declare Fx’ are fine. Re arrange the ‘Call Fx’ – put the seasons in order and the poem will make sense.


Activity:  U4Ch1L10_Level2: Add Additional ‘Call Fx’ to Increase the Height of the House.

Hint: I added 3 additional Floor ‘Call Fx’s


Activity:  U4Ch1L10_Level3: Debug & Edit The Fx.

Hint: In order to get the program to say it has zero dollars, just increase the number of Calls to 6.


Activity:  U4Ch1L10_Level4: Debug Fx: ‘Call Fx’ in an onEvent

Hint: Create two ‘Call Fx’ to match the ‘Declare Fx’ and place them in both ‘onEvent’s.


Activity:  U4Ch1L10_Level5: Create Fx to Eliminate Repeated Lines of Code (Cat’s Life.)

Hint: This is simple, find the lines that repeat, Declare a Fx and Call an Fx under each day of the week.


Activity:  U4Ch1L10_Level7: Don’t Place A ‘Var’ in an ‘onEvent’, What About A ‘Fx’?

Hint: You can’t have a ‘var’ in an ‘onEvent’, but you can have a ‘Fx’. The ‘var’ were created at the beginning of this program, and then they appear again in the Fx, but they are lines of code creating a ‘var’, so toss them and instead insert a purple block that allows you to set a value for the variable. Notice how you can have a Fx in an ‘onEvent’ with no problem.


Activity:  U4Ch1L10_Level8: Reduce Repeated Code With Fx. (3 Apps to Debug)

Hint: ‘Declare Fx’ and cut and paste from the Adult code the ‘if tickets>=20’, setProperty Sold Out. Below this, cut and paste the 2 ‘setProperty’ lines of code that show the amount of money and number of tickets sold on the App screen.  Also cut and paste the ‘playSound’.
I recommend you take a look at the App you wrote in the last lesson that showed you that you could add a value to a variable in an ‘onEvent’. It also showed you that you could ‘Call FX’ in an ‘onEvent.’ That is what you will do here. Create 3 ‘onEvent’with an attached green Fx and include in it the two purple variable lines of code that reset the variable to the numbe of tickets sold and dollars spent (again, you can get this code from previous programs you have written.). Remember to add the ‘Call Fx’ inside of the ‘onEvent with (green) Fx.